/**
 * Kalaisoo
 *
 * A lightweight no-framework framework written in PHP
 *
 * @package Kalaisoo
 * @author $Author: info@sah-company.com $
 */

/**
 * document.ready jquery stuff
 */
$(document).ready(function() {
	
	/**
	 * the avatar image can be cropped with Jcrop
	 */
	$('#avatar').Jcrop({
		aspectRatio: 1,
		onSelect: showCoords
	});
	
	/**
	 * updates the values of hidden coordinate fields
	 */
	function showCoords(c)
	{
		$('#x').val(c.x);
		$('#y').val(c.y);
		$('#x2').val(c.x2);
		$('#y2').val(c.y2);
		$('#w').val(c.w);
		$('#h').val(c.h);
	};

});